package com.tongji.housediy.view.component3D
{
	/**
	 * 
	 * @author xuxunjia
	 * 
	 */	
	import alternativa.engine3d.materials.TextureMaterial;
	import alternativa.engine3d.objects.Mesh;
	
	import com.tongji.housediy.vo.Goods;
	
	import flash.display.BitmapData;
	import flash.filters.GlowFilter;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	
	public class Wall extends Mesh
	{
		public var selected:Boolean = false;
		public var rawMaterial:TextureMaterial;
		public var newMaterial:TextureMaterial;
		public var length:Number;
		public var height:Number;
		public var wallBitmap:BitmapData = new BitmapData(2,2,false,0xffffff);
		public var underBitmap:BitmapData = new BitmapData(2,2,false,0x999999);
		public var wallCount:int;
		public var roomCount:int;
		
		public function Wall()
		{
			super();
		}
		
		public function resetMaterial(material:TextureMaterial):void
		{
			var rawBitmapData:BitmapData = material.texture;
			var newBitmapData:BitmapData = new BitmapData(rawBitmapData.width, rawBitmapData.height);
			newBitmapData.applyFilter(rawBitmapData, new Rectangle
				(0, 0, rawBitmapData.width, rawBitmapData.height), new Point(0, 0), new GlowFilter(0x7f007f, 1, 20, 20, 2, 1, true));
			this.rawMaterial = material;
			this.newMaterial = new TextureMaterial(newBitmapData);
		}
		
	}
}